<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/css/layui.css" rel="stylesheet">
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" th:value="${productcategory.id}" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">上级分类：</label>
                            <div class="col-sm-6">
                                <input id="pid" name="pid" th:value="${productcategory.pid}" class="form-control"
                                       type="hidden">
                                <input disabled th:value="${parentName}" id="pidName" class="form-control"
                                       type="text">
                            </div>
                            <input id="reset" class="btn btn-warning" type="button"  value="重置">
                            <input id="parentSelect" class="btn btn-warning" type="button" value="选择父分类">
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分类名称：</label>
                            <div class="col-sm-8">
                                <input id="name" name="name" th:value="${productcategory.name}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3 ">
                                <label class="control-label" style="float:right">分类图片：</label>

                            </div>
                            <input id="picture" name="picture" class="form-control" type="hidden"  th:value="${productcategory.picture}">
                            <div class="col-sm-8" >
                                <button type="button"  class="layui-btn" id="uploadBtn">
                                    <i class="fa fa-cloud"></i>上传文件
                                </button>
                                <div id="pictureShow">
                                    <label  th:if="${productcategory.picture==null||productcategory.picture==''}" >无</label>
                                    <img width="200px"  alt="image"   th:if="${productcategory.picture!=null&&productcategory.picture!=''}"  th:src="${productcategory.picture}" />
                                </div>
                            </div>

                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">是否激活：</label>
                            <div class="col-sm-8">
								<div class="switch onoffswitch col-sm-1">
									<div class="onoffswitch">
										<input id="isactive" name="isactive"
											   type="checkbox" th:checked="*{productcategory.active}"
											   value="1"     class="onoffswitch-checkbox"
										> <label class="onoffswitch-label" 	for="isactive">
										<span class="onoffswitch-inner"></span>
										<span class="onoffswitch-switch"></span>
									</label>
									</div>
								</div>
                            </div>
                        </div>
                        <div class="form-group" th:if="${productcategory.pid=='0'}" >
                            <label class="col-sm-3 control-label">是否首页显示：</label>
                            <div class="col-sm-8">
								<div class="switch onoffswitch col-sm-1">
									<div class="onoffswitch">
										<input id="isonmainpage" name="isonmainpage"
											   type="checkbox" th:checked="${productcategory.onMainPage}"
											   value="1"     class="onoffswitch-checkbox" >
										<label class="onoffswitch-label" 	for="isonmainpage">
											<span class="onoffswitch-inner"></span>
											<span class="onoffswitch-switch"></span>
										</label>
									</div>
								</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3 ">
                                <label class="control-label" style="float:right">分类图标：</label>
                            </div>
                            <input id="icon" name="icon" class="form-control" type="hidden"  th:value="${productcategory.icon}">
                            <div class="col-sm-8">
                                <button type="button" class="layui-btn" id="uploadIconBtn">
                                    <i class="fa fa-cloud"></i>上传文件
                                </button>
                                <div  id="iconShow">
                                    <label  th:if="${productcategory.icon==null||productcategory.icon==''}" >无</label>
                                    <img width="200px"  alt="icon"   th:if="${productcategory.icon!=null&&productcategory.icon!=''}"  th:src="${productcategory.icon}" />
                                </div>
                            </div>

                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script src="/js/layui.js"></script>
<script type="text/javascript" src="/js/appjs/shop/productcategory/edit.js">
</script>
</body>
</html>
